﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Specialized;
using Rated.DAL.Db;

namespace Rated.DAL.Repository
{
    public static class UserProfileRepository
    {
        public static void Update(int userId, NameValueCollection values)
        {
            var title = values["userProfile.Title"];
            var firstName = values["userProfile.FirstName"];
            var lastName = values["userProfile.lastName"];
            RatedEntities db = new RatedEntities();
            var item = db.UserProfiles.FirstOrDefault(o => o.UserId == userId);
            item.Title = title;
            item.FirstName = firstName;
            item.LastName = lastName;
            db.SaveChanges();
        }

    }
}
